package com.study.state.general.V2;

public class Context {
    public static final State STATE_A = new ConcreteStateA();
    public static final State STATE_B = new ConcreteStateB();
    {
        STATE_A.setContext(this);
        STATE_B.setContext(this);
    }

    private State current_state = STATE_A;

    public void setState(State state) {
        this.current_state = state;
        this.current_state.setContext(this);
    }

    public void handle(){
        this.current_state.handle();
    }
}
